package com.iwhalecloud.bss.kite.cucc.manager.scene.service.query;

import com.iwhalecloud.bss.kite.manager.scene.service.query.QueryInstService;
import org.springframework.stereotype.Service;

/**
 * 销售品关联合同实例查询类
 */
@Service("manager.localQueryOfferInstContractRelService")
public class LocalQueryOfferInstContractRelService extends QueryInstService {

//    /**
//     * 获取所有销售品关联账户实例
//     * @param sceneInstId
//     * @return
//     */
//    public List<KiteOfferInstContract> listOfferInstContractRels(String sceneInstId) {
//        KiteSceneInst sceneInst = TransactionContext.getContainer().getSceneInst(sceneInstId);
//        String custId = SceneInstUtils.getCustId(sceneInst);
//        List<InstVertex> instVertexs = SceneInstUtils.listInstVertexs(sceneInst, InstType.OFFER_INST_CONTRACT);
//        return InstUtils.transformInsts(custId, instVertexs);
//    }
//
//    /**
//     * 获取接入产品实例的所有账户实例
//     * @param custId
//     * @param prodInstId
//     * @return
//     */
//    public List<KiteOfferInstContract> listOfferInstContractRels(String custId, String offerInstId, InstType offerInstType) {
//        IInstRelGraph custInstRelGraph = TransactionContext.getContainer().getCustInstRelGraph(custId);
//        InstVertex instVertex = InstRelGraphUtils.getCustInstVertex(custId, offerInstType, offerInstId);
//        if (Objects.isNull(instVertex)) {
//            ErrorConsts.OFFER_INST_NOT_EXIST.throwOut(offerInstId, custId);
//        }
//
//        if (instVertex instanceof ISubOfferInstContractRel) {
//            ((ISubOfferInstContractRel) instVertex).listSubOfferInstContractRels(custInstRelGraph);
//        }
//
//        List<InstVertex> instVertexs = InstRelGraphUtils.listSubInstVertexs(custInstRelGraph, instVertex,
//            RelType.OFFER_CONTRACT_REL_TYPE_1000, InstType.OFFER_INST_CONTRACT_REL);
//        return InstUtils.transformInsts(custId, instVertexs);
//    }
}
